import {getLocal} from "../../utils/local";

export async function addFav(designId) {
    var Dao = AV.Object.extend('fav');
    var favDao = new Dao()
    favDao.set("designId", designId)
    favDao.set("userId", getLocal('app.login_user').objectId)
    var saveResult = (await favDao.save()).toJSON()
    return saveResult
}

export async function deletFav(favId) {
    var todo = AV.Object.createWithoutData('fav', favId);
    var deleteRes = await todo.destroy()
    return deleteRes
}